package cardGame;

import junit.framework.TestCase;
import cardGame.HoyleDeck;

public class DeckTester extends TestCase {

	public void testShuffle() {
		boolean notInOrder=true; 
		HoyleDeck testDeck= new HoyleDeck();	
		testDeck.shuffle();
		
		for(int i=0 ; i+2<52 ; i++) {		//(i+2) to account for [1+2] arrays.
			if(testDeck.getDeck()[i].getFaceValue().ordinal() == testDeck.getDeck()[i+1].getFaceValue().ordinal()-1 &&		//first and second are in order
			testDeck.getDeck()[i+1].getFaceValue().ordinal()-1 == testDeck.getDeck()[i+2].getFaceValue().ordinal()-2 &&		//second and third are in order
			testDeck.getDeck()[i].getSuit() == testDeck.getDeck()[i+1].getSuit() &&			//all three are the same suit
			testDeck.getDeck()[i+1].getSuit() == testDeck.getDeck()[i+2].getSuit()) {
				notInOrder=false;	
			}
		}
		assertEquals(true, notInOrder);
	}


	
	
	public void testDeal() {
		boolean equalNumCards=false;
		//not sure how to call the deal meathod without numPlayers entered in the constructor.
		for (Player p : WarGame.players)
			WarGame.deal(testDeck);
			
		
		assertEquals(equalNumCards ,true);
	}
		
		
		
		
		
		

}
